package com.neteast.androidclient.newscenter.service;

import com.neteast.androidclient.newscenter.util.ApkManager;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

public class DownLoadService extends Service {

	@Override
	public IBinder onBind(Intent intent) {
		return null;
	}
	
	@Override
	public void onCreate() {
		super.onCreate();
	}
	
	@Override
	public int onStartCommand(Intent intent, int flags, int startId) {
		String extra = intent.getStringExtra("apk_url");
		if (extra!=null&&!extra.trim().equals("")) {
			long size = intent.getLongExtra("size", 100);
			ApkManager apkManager=new ApkManager(this);
			apkManager.execute(extra,size);
		}
		return super.onStartCommand(intent, flags, startId);
	}
	
	@Override
	public void onDestroy() {
		super.onDestroy();
		Log.i("test", "onDestroy");
	}
}
